---
title: Alibaba Tongyi
---

The `AlibabaTongyiEmbeddings` class uses the Alibaba Tongyi API to generate embeddings for a given text.

## Setup

You'll need to sign up for an Alibaba API key and set it as an environment variable named `ALIBABA_API_KEY`.

Then, you'll need to install the [`@langchain/community`](https://www.npmjs.com/package/@langchain/community) package:

import IntegrationInstallTooltip from '/snippets/javascript-integrations/integration-install-tooltip.mdx';

<IntegrationInstallTooltip/>

```bash npm
npm install @langchain/community @langchain/core
```

## Usage

import AlibabaTongyi from "/snippets/javascript-integrations/examples/embeddings/alibaba_tongyi.mdx";

<AlibabaTongyi />

## Related

- Embedding model [conceptual guide](/oss/concepts/embedding_models)
- Embedding model [how-to guides](/oss/how-to/#embedding-models)
